﻿using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;
using static Modules.System.Flow.FlowConstants;

namespace Modules
{
    /// <summary>
    /// 流程引擎信息表
    ///</summary>
    [TableName("sys_flow_engine")]
    [Description("流程步骤信息")]
    [PrimaryKey("id", AutoIncrement = true)]
    [CacheSetting(true, PropertyNamesOfArea = "FlowId")]
    [Serializable]
    public class SysFlowEngine : IEntity
    {
        /// <summary>
        /// 主键
        ///</summary>
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        /// 流程id
        ///</summary>
        [Column("flow_id")]
        public int FlowId { get; set; }

        /// <summary>
        /// 步骤编码
        ///</summary>
        [Column("code")]
        public FlowEngine Code { get; set; }

        /// <summary>
        /// 步骤名称
        ///</summary>
        [Column("name")]
        public string Name { get; set; }

        /// <summary>
        /// 步骤顺序
        ///</summary>
        [Column("sort")]
        public int? Sort { get; set; }

        /// <summary>
        /// 创建时间
        ///</summary>
        [Column("create_time")]
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 退回编码
        ///</summary>
        [Column(Name = "send_back_code")]
        public FlowEngine? SendBackCode { get; set; }

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return this.Id; } }

        #endregion IEntity 成员
    }
}